Page({
  data: {
    id: '',
    detail: {}
  },
  onLoad ({ id }) {
    this.setData({ id })
    this.getDetail()
  },
  async getDetail () {
    const res = await wx.$http.get(`/room/${this.data.id}`)
    if (res.code !== 10000) return wx.$utils.toast('获取详情失败')
    this.setData({
      detail: res.data
    })
  },
  editHouse () {
    wx.navigateTo({
      url: '/house_pkg/pages/form/index?id=' + this.data.id
    })
  }
})
